package com.jinduplan.planmanager.widgets;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class SelectDialog extends Dialog {
    private final String TAG = SelectDialog.class.getSimpleName();

    public SelectDialog(int screenWidth, int screenHeight, Context context, int widOff, int heiOff, View layout, int style, int type) {
        super(context, style);
        setContentView(layout);
        Window window = getWindow();
        WindowManager.LayoutParams params = window.getAttributes();
        if (type == 1) {//菜单
//            params.width = (int) (((double) screenWidth) * 0.4d);
            params.gravity = Gravity.TOP|Gravity.RIGHT;
//            params.x = (int) (((double) screenWidth) );
//            params.y = (int) (((double) screenWidth) * 0.15d);
        } else if (type == 2) {
//            params.width = (int) (((double) screenWidth) * 0.2d);
            params.gravity = Gravity.BOTTOM;
//            params.x = widOff - (params.width / 2);
//            params.y = (screenHeight / 2) - heiOff;
        }
        window.setAttributes(params);
    }
}